﻿namespace Creek.UI.EFML.Base.JS.ScriptingTypes.Info
{
    using System.Management;

    public class Hardware
    {
        public class Keyboard
        {
            #region Public Properties

            public string KeyboardName
            {
                get
                {
                    var managementObjectSearcher = new ManagementObjectSearcher(
                        "root\\CIMV2", "SELECT * FROM Win32_Keyboard");
                    ManagementObjectCollection.ManagementObjectEnumerator enumerator;

                    enumerator = managementObjectSearcher.Get().GetEnumerator();
                    enumerator.MoveNext();

                    return enumerator.Current["Name"].ToString();
                }
            }

            #endregion
        }

        public class Monitor
        {
            #region Public Properties

            public string MonitorName
            {
                get
                {
                    var managementObjectSearcher = new ManagementObjectSearcher(
                        "root\\CIMV2", "SELECT * FROM Win32_DesktopMonitor");
                    ManagementObjectCollection.ManagementObjectEnumerator enumerator;
                    enumerator = managementObjectSearcher.Get().GetEnumerator();
                    enumerator.MoveNext();

                    return enumerator.Current["Name"].ToString();
                }
            }

            #endregion
        }
    }
}